home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2003 December / PCpro_2003_12.ISO / files / trials / mathcad / program files / mathsoft / mathcad 11 / qsheet / matlab.txt < prev    next >
Encoding:
Text File  |  1997-06-01  |  635 b   |  21 lines

  1. % Get the adjacency list and convert it to a Matlab sparse matrix
  2. ADJ = spconvert([in0 ones(180,1)])
  3.  
  4. % Get the XYZ coordinates of carbon atoms in the C60 molecule
  5. XYZ = in1
  6.  
  7. % We'll draw the two "halves" of the molecule separately
  8. % (and in different colors). The sparse matrix hADJ
  9. %  corresponds to one half of the molecule.
  10. hADJ = sparse(60,60);
  11. n = 31:60;
  12. hADJ(n,n) = ADJ(n,n);
  13.  
  14. % We'll construct the plot using two calls to Matlab's gplot
  15. % function - each call drawing one half of the molecule.
  16. gplot(hADJ,XYZ,'m-');
  17. axis('equal','off')
  18. title('Rotating Buckyball')
  19. hold on
  20. gplot(ADJ-hADJ,XYZ,'c-');
  21. hold off